<?php
include 'connection.php';

$id = (int) $_POST['id'];

if (trim($_POST['password'])) {

    $password = md5(trim($_POST['password']));

    $username = trim($_POST['username']);

	$sql = "update user set username='".$username."',password='".$password."'where id = ".$id;

} else { 

	echo "修改成功";
}

$result = mysqli_query($conn, $sql);

if ($result) {

	echo "修改成功";
}